﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace PlayerScanner
{
    public class MagCompactConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            var ret = String.Empty;

            if (values != null)
            {
                //Extract the properties
                var itemName = (string)values[0];
                var defLevel = (int)values[1];
                var powLevel = (int)values[2];
                var dexLevel = (int)values[3];
                var mstLevel = (int)values[4];
                var level = (int)values[5];

                var sb = new StringBuilder();

                ret = sb.Append(itemName).Append("  ")
                    .Append(defLevel).Append("/")
                    .Append(powLevel).Append("/")
                    .Append(dexLevel).Append("/")
                    .Append(mstLevel).Append(" = ").Append(level).ToString();
            }

            return ret;
        }

        public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
        {
            // Do nothing
            return null;
        }
    }
}
